﻿using AbpProjectTemplate.Utilities.Enums;
using AbpProjectTemplate.Utilities.Json;
using Newtonsoft.Json;
using System;
using System.ComponentModel;

namespace AbpProjectTemplate.Application.Shared.Dtos
{
    [ShowOnApi]
    public enum TestEnum
    {
        [Description("等级1")]
        Level1 = 1,
        [Description("等级2")]
        Level2 = 2
    }

    public class JsonTestDto
    {
        //[JsonConverter(typeof(XXXXDateTimeJsonConverter))]
        public DateTime Dt { get; set; }

        //;[JsonConverter(typeof(DateTimeJsonConverter))]
        public DateTime? CanNullDt { get; set; }

        //[JsonConverter(typeof(DecimalJsonConverter))]
        public decimal? CanNullDecimal { get; set; }

        public decimal Decimal { get; set; }

        [JsonConverter(typeof(DescEnumJsonConverter))]
        public TestEnum Enum1 { get; set; }

        public TestEnum? CanNullEnum { get; set; }

        public JsonTestDto2 Path2 { get; set; }
    }

    public class JsonTestDto2
    {
        public TestEnum Enum2 { get; set; }
    }
}
